package com.study.springboot.client;

import com.study.springboot.dto.Depart;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author huyong
 * @Decription
 * @date 2025-03-11 16:29
 */
@FeignClient(name = "provider", path = "api/v1/provicer/depart")
public interface DepartClient {

    @PostMapping
    boolean saveDepart(@RequestBody Depart depart);

    @PutMapping
    boolean modifyDepart(@RequestBody Depart depart);

    @DeleteMapping("/{id}")
    boolean deleteDepartById(@PathVariable("id") Integer id);

    @GetMapping("/{id}")
    Depart getDepartById(@PathVariable("id") Integer id);

    @GetMapping
    List<Depart> getAllDeparts();

    @GetMapping("/port")
    Map<String, Integer> getPort();
}
